﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using TPOJ.Model;

namespace TPOJ.Web.ViewModel
{
    public class StatisticsRecord
    {
        public int ContestId { get; set; }
        public int ProblemId { get; set; }

        public int UserCountSubmitted { get; set; }
        public int UserCountSolved { get; set; }

        public Dictionary<byte, int> ResultsCount { get; set; }
        public Dictionary<string, int> LanguagesCount { get; set; }

        public StatisticsRecord(IList<Core.Language> langs)
        {
            this.ResultsCount = new Dictionary<byte, int>();
            this.LanguagesCount = new Dictionary<string, int>();
            for (byte i = 0; i <= (byte)TPOJ.Core.ResultType.Accepted; i++)
            {
                ResultsCount[i] = 0;
            }
            foreach (var item in langs)
            {
                LanguagesCount[item.Name] = 0;
            }
        }
    }
}